#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QPushButton>
#include <QDesktopWidget>
#include <QApplication>
#include <QCloseEvent>
#include <QMessageBox>
#include <QLabel>
#include <QLayout>
#include <QPainter>
#include <QTextCodec>
#include <QDialog>
#include "dockwindow.h"
#include "jserver.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow();
    ~MainWindow();
    void dataRead();
    bool quit();
    JServer *server;

private:
    int readDataTimeId;
    int showDataTimeId;
    int runTimeId;
    int hour;
    int minute;
    int second;
    QLabel *Cpu;
    QLabel *Memory;
    QLabel *Flow;
    QLabel *Temperature;
    QLabel *pushText;
    QLabel *sideLabel;
    QLabel *nodeTextLabel;
    QLabel *onlineNodeLabel;
    QLabel *timeInfoLabel;
    QWidget *widget;
    QGridLayout *winLayout;
    QPushButton *cpuButton;
    QPushButton *memButton;
    QPushButton *flowButton;
    QPushButton *exit;
    DrawCurve *cpuCurve;
    DrawCurve *memoryCurve;
    DrawCurve *flowCurve;
    DrawCurve *temperatureCurve;
    QDesktopWidget *destop;
    DockWindow *cpuDockWin;
    DockWindow *memDockWin;
    DockWindow *flowDockWin;
    void paintEvent(QPaintEvent *);
    void timerEvent(QTimerEvent *e);
    void closeEvent(QCloseEvent *);

public slots:
    void cpuDockWindow();
    void memDockWindow();
    void flowDockWindow();
};

#endif // MAINWINDOW_H
